package com.example.templatedemo

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.ViewDataBinding
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.DataBindingHolder
import com.example.lib_common.base.getItemViewBinding

abstract class MyBaseQuickAdapter<T : Any, DB : ViewDataBinding?> :
    BaseQuickAdapter<T, DataBindingHolder<DB>>() {
    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): DataBindingHolder<DB> {
        return DataBindingHolder(getItemViewBinding(LayoutInflater.from(context), parent))
    }
}